package com.geen.tuoke.ui.adapter

import android.view.View
import com.blankj.utilcode.util.ToastUtils
import com.geen.tuoke.R
import com.geen.tuoke.base.BaseAdapter
import com.geen.tuoke.bean.TaskDetailInfo
import com.geen.tuoke.databinding.ItemTaskDetailBinding
import com.qmuiteam.qmui.kotlin.onClick


/**
 * @author 文庆

 * @date 2022/1/3.
 * @description
 */
class TaskDetailAdapter(
) : BaseAdapter<TaskDetailInfo, ItemTaskDetailBinding>(R.layout.item_task_detail, null) {
    override fun onUpdate(binding: ItemTaskDetailBinding, item: TaskDetailInfo, position: Int) {
        binding.run {
            data = item
//            addChildClickViewIds(R.id.iv_more)

            binding.ivMore.onClick {
                moreMethod?.invoke(it,item,position)
            }
        }
    }

    var moreMethod: ((view: View, item: TaskDetailInfo, position: Int) -> Unit)? = null
    fun addMoreListener(block: (view: View,item: TaskDetailInfo, position: Int) -> Unit) {
        moreMethod = block
    }

}



